
import request from '../../utils/request'

//获取盘点一级分组
export  function getFirstGroup(saleOrganizationID:string,shopID:string,checkTemplateID:string) {
  return request({
    url: '/system/goodsgroup/getCheckFirstGoodsGroup',
    method: 'get',
    params:{saleOrganizationID,shopID,checkTemplateID}
  })
}

//获取盘点二级分组
export  function getSecondGroup(saleOrganizationID:string,shopID:string,checkTemplateID:string,firstGoodsGroupID:string) {
  return request({
    url: '/system/goodsgroup/getCheckSecondGoodsGroup',
    method: 'get',
    params:{saleOrganizationID,shopID,checkTemplateID,firstGoodsGroupID}
  })
}

//获取盘点记录明细
export  function getCheckDetails(saleOrganizationID:string,shopID:string,checkTemplateID:string,groupID_K:string,shopCheckID:string) {
  return request({
    url: '/sale/shopCheck/shopCheckDetailsCs',
    method: 'get',
    params:{saleOrganizationID,shopID,checkTemplateID,groupID_K,shopCheckID}
  })
}


//单行保存
export  function rowSave(saleOrganizationID:string,shopID:string,shopCheckID:string,checkGoodsDtos:Array<any>) {
  return request({
    url: '/sale/shopCheck/shopCheckGoodsSaveCs',
    method: 'post',
    data:{saleOrganizationID,shopID,shopCheckID,checkGoodsDtos}
  })
}

//重盘
export  function reCheck(saleOrganizationID:string,shopCheckID:string,goodsID:string) {
  return request({
    url: `/sale/shopCheck/posCheckAgainCs?saleOrganizationID=${saleOrganizationID}&shopCheckID=${shopCheckID}&goodsID=${goodsID}`,
    method: 'post',
    data:{}
   
  })
}

//提交盘点单
export  function submitCheck(saleOrganizationID,shopCheckID:string,shopName:string) {
  return request({
    url: `/sale/shopCheck/shopCheckSubmitCs`,
    method: 'get',
    params:{saleOrganizationID,shopCheckID,shopName}
  })
}